function copyleft() local str= string.gsub([[

-------------------------------------------------------------------
This file is part of Compass.

Compass is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Compass is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Compass.  If not, see <http://www.gnu.org/licenses/>.
-------------------------------------------------------------------]],'\n','\n-- ')
   print(str)
end

----------------------------------------------------------------
-- iterator for just values of a table
function values (t)
   local i = 0
   local n = table.getn(t)
   return function ()
	     i = i + 1
	     if i <= n then return t[i] end
	  end
end

----------------------------------------------------------------
-- self-initializing 2-level nested array
function inc2(bins,inner,outer)
   if not bins[outer]        then bins[outer]        = {} end
   if not bins[outer][inner] then bins[outer][inner] =  0 end
   bins[outer][inner] = bins[outer][inner] + 1      
end

-- testing inc2
function _inc2()
   local function worker ()
      local b={}
      math.randomseed(1)
      for i=1,1000 do inc2(b,math.random(16),math.random(16)) end
      end
   time(worker,100)
end

----------------------------------------------------------------
-- run x() for r() repeats
function time(x,r)
   r = r or 10
   local start = os.clock()
   for i = 1,r do x() end
   print(string.format("%.7f secs each",(os.clock() - start)/r))
end

-- testing time
function _time()
   local x 
   local function fib(n)
      if n<2 then return 1 else return fib(n-1) + fib(n-2) end
   end
   time((function () x=fib(28) end),400)
   print(x)
end 

_time()
